package xy.customer.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

import xy.customer.UserFeignClient;
import xy.customer.entity.User;

@RestController
public class MovieController {
	
	@Autowired
	private UserFeignClient userFeignClient;
	
	@GetMapping("/coustomer/{id}")
	public User findById(@PathVariable Long id) {
		
		return userFeignClient.findById(id);
		
	}
	
	@PostMapping("/testPost")
	public User testPost() {
		
		User user = new User();
		user.setAge(888);
		
		return userFeignClient.postUser(user);
	}

}
